package com.tensquare.sms.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = {"q1"}) //声明从哪些队列接受消息
public class Q1Listener {
   @RabbitHandler //接受到消息的处理方法
   public void reciveMsg(String msg){
      System.out.println("从Q1队列中取出:"+msg);
   }

}
